<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  
  
  </head>
  
  <body>
    <form action="login" method="post">
    	<img id="haha" src=""/>
    	<input name="account" onchange="No()">
    	<input name="password" type="password">
    	<input type="submit" value="提交" />
    	<a href="add"><input type="button" value="注册"/></a>
    </form>
    <c:remove var="error"/>
  <script type="text/javascript" src="js/jquery-1.12.4.js"></script>
  <script type="text/javascript">
  	function No(){
  	 var na = $("[name = account]").val();
  	 if(na != null && na != ''){
  	 	$.get("img?account="+na,
  	 	function(data){
  	 		if(data != null){$("#haha").attr("src",data);}
  	 	}
  	 	);
  	 }
  	}
  </script>
  </body>
</html>
